import UIKit

/**
    B站：https://www.bilibili.com/video/BV144411C7Gg?p=20

    第20课
        1. 定义枚举
        2. 设置枚举初始值
    
*/

enum TestEnum {
    case A
    case B
    case C
}

print(TestEnum.A)
print(type(of: TestEnum.A))

enum PlayEnum: Int {
    case stop = 0
    case play = 1
    case pause = 2
    case final = 3
}

func enumEqual(param: Int, caseValue: PlayEnum) {
    if (param == caseValue.rawValue) {
        print("PlayEnum == equal")
    } else {
        print("PlayEnum != not equal")
    }
}

enumEqual(param: 2, caseValue: PlayEnum.stop)
enumEqual(param: 2, caseValue: PlayEnum.pause)


enum PlayEnum2222: String {
    case stop = "play_status_stop"
    case play = "play_status_play"
    case pause = "play_status_pause"
    case final = "play_status_final"
}


